package com.ruoyi.fs.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fs.mapper.FsFullViewMapper;
import com.ruoyi.fs.domain.FsFullView;
import com.ruoyi.fs.service.IFsFullViewService;

/**
 * 案件全景Service业务层处理
 *
 * @author hero
 * @date 2024-09-11
 */
@Service
public class FsFullViewServiceImpl implements IFsFullViewService {
    @Autowired
    private FsFullViewMapper fsFullViewMapper;

    /**
     * 查询案件全景
     *
     * @param id 案件全景主键
     * @return 案件全景
     */
    @Override
    public FsFullView selectFsFullViewById(Long id) {
        return fsFullViewMapper.selectFsFullViewById(id);
    }

    /**
     * 查询案件全景
     *
     * @param bh 案件全景标号
     * @return 案件全景
     */
    @Override
    public FsFullView selectFsFullViewByBh(String bh) {
        FsFullView query = new FsFullView();
        query.setBh(bh);
        List<FsFullView> list = fsFullViewMapper.selectFsFullViewList(query);
        if (list.isEmpty()) {
            return null;
        } else {
            return list.get(0);
        }
    }

    /**
     * 查询案件全景列表
     *
     * @param fsFullView 案件全景
     * @return 案件全景
     */
    @Override
    public List<FsFullView> selectFsFullViewList(FsFullView fsFullView) {
        return fsFullViewMapper.selectFsFullViewList(fsFullView);
    }

    /**
     * 新增案件全景
     *
     * @param fsFullView 案件全景
     * @return 结果
     */
    @Override
    public int insertFsFullView(FsFullView fsFullView) {
        fsFullView.setCreateTime(DateUtils.getNowDate());
        return fsFullViewMapper.insertFsFullView(fsFullView);
    }

    /**
     * 修改案件全景
     *
     * @param fsFullView 案件全景
     * @return 结果
     */
    @Override
    public int updateFsFullView(FsFullView fsFullView) {
        fsFullView.setUpdateTime(DateUtils.getNowDate());
        return fsFullViewMapper.updateFsFullView(fsFullView);
    }

    /**
     * 批量删除案件全景
     *
     * @param ids 需要删除的案件全景主键
     * @return 结果
     */
    @Override
    public int deleteFsFullViewByIds(Long[] ids) {
        return fsFullViewMapper.deleteFsFullViewByIds(ids);
    }

    /**
     * 删除案件全景信息
     *
     * @param id 案件全景主键
     * @return 结果
     */
    @Override
    public int deleteFsFullViewById(Long id) {
        return fsFullViewMapper.deleteFsFullViewById(id);
    }
}
